package com.elric.mall.controller;

import com.elric.mall.mapper.BaseInfoMapper;
import com.elric.mall.mapper.BaseUpperUnitMapper;
import com.elric.mall.common.api.CommonResult;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "BaseInfoController", description = "基础信息接口")
@RestController
@RequestMapping("/baseInfo")
public class BaseInfoController {
    @Autowired
    BaseUpperUnitMapper baseUpperUnitMapper;
    @Autowired
    BaseInfoMapper baseInfoMapper;

    @GetMapping("/getUpperList")
    public CommonResult getUpperList() {
        return CommonResult.success(baseUpperUnitMapper.selectAll());
    }

    @GetMapping("/getBaseInfoByType")
    public CommonResult getBaseInfoByType(@RequestParam String type) {
        return CommonResult.success(baseInfoMapper.getBaseInfoByType(type));
    }

    @GetMapping("/getBaseNltx")
    public CommonResult getBaseNltx() {
        return CommonResult.success(baseInfoMapper.getBaseNltx());
    }

    @GetMapping("/getProjectGroupList")
    public CommonResult getProjectGroupList() {
        return CommonResult.success(baseInfoMapper.getProjectGroupList());
    }

    @GetMapping("/getProjectStatusList")
    public CommonResult getProjectStatusList() {
        return CommonResult.success(baseInfoMapper.getProjectStatusList());
    }

    @GetMapping("/getLocationList")
    public CommonResult getLocationList() {
        return CommonResult.success(baseInfoMapper.getLocationList());
    }

    @GetMapping("/getZztxList")
    public CommonResult getZztxList() {
        return CommonResult.success(baseInfoMapper.getZztxList());
    }
}
